package com.rightsidetech.system.dtos.request;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.List;

/**
 * @author yhr
 * @version 1.0
 * @Title:
 * @Package
 * @Description: 描述
 * @date 2021/10/20
 */
@Data
public class SysRoleAddReq implements Serializable {
    @ApiModelProperty(value = "角色名称", required = true)
    @NotEmpty(message = "角色名称不能为空")
    @Length(max = 10,message = "角色名称最长10位")
    @Pattern(regexp = "^$|[\\u4e00-\\u9fa5]+", message = "名称输入中文")
    private String name;
    @ApiModelProperty(value = "角色描述", required = true)
    @NotEmpty(message = "角色描述不能为空")
    @Length(max = 50,message = "角色描述最长50位")
    private String roleDetail;

    @ApiModelProperty(value = "权限列表", required = true)
    @NotEmpty(message = "权限列表不能为空")
    @Valid
    private List<Long> resourceList;
}
